Optimal. Leaf size=181 \[ \frac {d^2 \text {Li}_3\left (e^{2 i (a+b x)}\right )}{2 b^3}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}-\frac {i d (c+d x) \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \sin (a+b x) \cos (a+b x)}{2 b^2}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}+\frac {c d x}{2 b}+\frac {d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.23, antiderivative size = 181, normalized size of antiderivative = 1.00, number of steps used = 9, number of rules used = 8, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.364, Rules used = {4408, 4404, 3310, 3717, 2190, 2531, 2282, 6589} \[ -\frac {i d (c+d x) \text {PolyLog}\left (2,e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \text {PolyLog}\left (3,e^{2 i (a+b x)}\right )}{2 b^3}-\frac {d (c+d x) \sin (a+b x) \cos (a+b x)}{2 b^2}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}+\frac {c d x}{2 b}+\frac {d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 2190
Rule 2282
Rule 2531
Rule 3310
Rule 3717
Rule 4404
Rule 4408
Rule 6589
Rubi steps
\begin {align*} \int (c+d x)^2 \cos ^2(a+b x) \cot (a+b x) \, dx &=\int (c+d x)^2 \cot (a+b x) \, dx-\int (c+d x)^2 \cos (a+b x) \sin (a+b x) \, dx\\ &=-\frac {i (c+d x)^3}{3 d}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}-2 i \int \frac {e^{2 i (a+b x)} (c+d x)^2}{1-e^{2 i (a+b x)}} \, dx+\frac {d \int (c+d x) \sin ^2(a+b x) \, dx}{b}\\ &=-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {d (c+d x) \cos (a+b x) \sin (a+b x)}{2 b^2}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}+\frac {d \int (c+d x) \, dx}{2 b}-\frac {(2 d) \int (c+d x) \log \left (1-e^{2 i (a+b x)}\right ) \, dx}{b}\\ &=\frac {c d x}{2 b}+\frac {d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \cos (a+b x) \sin (a+b x)}{2 b^2}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}+\frac {\left (i d^2\right ) \int \text {Li}_2\left (e^{2 i (a+b x)}\right ) \, dx}{b^2}\\ &=\frac {c d x}{2 b}+\frac {d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^2}-\frac {d (c+d x) \cos (a+b x) \sin (a+b x)}{2 b^2}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}+\frac {d^2 \operatorname {Subst}\left (\int \frac {\text {Li}_2(x)}{x} \, dx,x,e^{2 i (a+b x)}\right )}{2 b^3}\\ &=\frac {c d x}{2 b}+\frac {d^2 x^2}{4 b}-\frac {i (c+d x)^3}{3 d}+\frac {(c+d x)^2 \log \left (1-e^{2 i (a+b x)}\right )}{b}-\frac {i d (c+d x) \text {Li}_2\left (e^{2 i (a+b x)}\right )}{b^2}+\frac {d^2 \text {Li}_3\left (e^{2 i (a+b x)}\right )}{2 b^3}-\frac {d (c+d x) \cos (a+b x) \sin (a+b x)}{2 b^2}+\frac {d^2 \sin ^2(a+b x)}{4 b^3}-\frac {(c+d x)^2 \sin ^2(a+b x)}{2 b}\\ \end {align*}
________________________________________________________________________________________
Mathematica [B] time = 2.90, size = 564, normalized size = 3.12 \[ \frac {48 b^3 c d x^2 \cot (a)-48 b^3 c d x^2 e^{i \tan ^{-1}(\tan (a))} \cot (a) \sqrt {\sec ^2(a)}+48 b^2 c^2 \log (\sin (a+b x))-6 b^2 c^2 \csc (a) \sin (a+2 b x)+6 b^2 c^2 \csc (a) \sin (3 a+2 b x)-96 i b^2 c d x \tan ^{-1}(\tan (a))+96 b^2 c d x \log \left (1-e^{2 i \left (\tan ^{-1}(\tan (a))+b x\right )}\right )-12 b^2 c d x \csc (a) \sin (a+2 b x)+12 b^2 c d x \csc (a) \sin (3 a+2 b x)+48 b^2 d^2 x^2 \log \left (1-e^{-i (a+b x)}\right )+48 b^2 d^2 x^2 \log \left (1+e^{-i (a+b x)}\right )-6 b^2 d^2 x^2 \csc (a) \sin (a+2 b x)+6 b^2 d^2 x^2 \csc (a) \sin (3 a+2 b x)-48 i b c d \text {Li}_2\left (e^{2 i \left (b x+\tan ^{-1}(\tan (a))\right )}\right )+96 b c d \tan ^{-1}(\tan (a)) \log \left (1-e^{2 i \left (\tan ^{-1}(\tan (a))+b x\right )}\right )-6 b c d \csc (a) \cos (a+2 b x)+6 b c d \csc (a) \cos (3 a+2 b x)-96 b c d \tan ^{-1}(\tan (a)) \log \left (\sin \left (\tan ^{-1}(\tan (a))+b x\right )\right )+96 i b d^2 x \text {Li}_2\left (-e^{-i (a+b x)}\right )+96 i b d^2 x \text {Li}_2\left (e^{-i (a+b x)}\right )+96 d^2 \text {Li}_3\left (-e^{-i (a+b x)}\right )+96 d^2 \text {Li}_3\left (e^{-i (a+b x)}\right )-6 b d^2 x \csc (a) \cos (a+2 b x)+6 b d^2 x \csc (a) \cos (3 a+2 b x)+3 d^2 \csc (a) \sin (a+2 b x)-3 d^2 \csc (a) \sin (3 a+2 b x)+16 i b^3 d^2 x^3+48 i \pi b^2 c d x+48 \pi b c d \log \left (1+e^{-2 i b x}\right )-48 \pi b c d \log (\cos (b x))}{48 b^3} \]
Warning: Unable to verify antiderivative.
[In]
[Out]
________________________________________________________________________________________
fricas [C] time = 0.56, size = 594, normalized size = 3.28 \[ -\frac {b^{2} d^{2} x^{2} + 2 \, b^{2} c d x - {\left (2 \, b^{2} d^{2} x^{2} + 4 \, b^{2} c d x + 2 \, b^{2} c^{2} - d^{2}\right )} \cos \left (b x + a\right )^{2} - 4 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 4 \, d^{2} {\rm polylog}\left (3, \cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 4 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - 4 \, d^{2} {\rm polylog}\left (3, -\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) + 2 \, {\left (b d^{2} x + b c d\right )} \cos \left (b x + a\right ) \sin \left (b x + a\right ) - {\left (-4 i \, b d^{2} x - 4 i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - {\left (4 i \, b d^{2} x + 4 i \, b c d\right )} {\rm Li}_2\left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - {\left (4 i \, b d^{2} x + 4 i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right )\right ) - {\left (-4 i \, b d^{2} x - 4 i \, b c d\right )} {\rm Li}_2\left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right )\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + b^{2} c^{2}\right )} \log \left (\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) + \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) - 2 \, {\left (b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} \log \left (-\frac {1}{2} \, \cos \left (b x + a\right ) - \frac {1}{2} i \, \sin \left (b x + a\right ) + \frac {1}{2}\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) + i \, \sin \left (b x + a\right ) + 1\right ) - 2 \, {\left (b^{2} d^{2} x^{2} + 2 \, b^{2} c d x + 2 \, a b c d - a^{2} d^{2}\right )} \log \left (-\cos \left (b x + a\right ) - i \, \sin \left (b x + a\right ) + 1\right )}{4 \, b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
giac [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int {\left (d x + c\right )}^{2} \cos \left (b x + a\right )^{2} \cot \left (b x + a\right )\,{d x} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maple [B] time = 0.49, size = 535, normalized size = 2.96 \[ \frac {d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{3}}-\frac {2 d^{2} a^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x^{2}}{b}-\frac {d^{2} \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a^{2}}{b^{3}}+\frac {d^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x^{2}}{b}+\frac {4 i d^{2} a^{3}}{3 b^{3}}-i c d \,x^{2}-\frac {4 i c d a x}{b}+i c^{2} x -\frac {2 c^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b}+\frac {c^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b}+\frac {c^{2} \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right )}{b}-\frac {i d^{2} x^{3}}{3}+\frac {2 d^{2} \polylog \left (3, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}+\frac {2 d^{2} \polylog \left (3, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{3}}-\frac {d \left (d x +c \right ) \sin \left (2 b x +2 a \right )}{4 b^{2}}+\frac {2 c d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b}+\frac {2 c d \ln \left (1-{\mathrm e}^{i \left (b x +a \right )}\right ) a}{b^{2}}+\frac {2 c d \ln \left ({\mathrm e}^{i \left (b x +a \right )}+1\right ) x}{b}+\frac {4 c d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 c d a \ln \left ({\mathrm e}^{i \left (b x +a \right )}-1\right )}{b^{2}}+\frac {2 i d^{2} a^{2} x}{b^{2}}-\frac {2 i c d \,a^{2}}{b^{2}}-\frac {2 i d^{2} \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 i d^{2} \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right ) x}{b^{2}}-\frac {2 i c d \polylog \left (2, -{\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}-\frac {2 i c d \polylog \left (2, {\mathrm e}^{i \left (b x +a \right )}\right )}{b^{2}}+\frac {\left (2 d^{2} x^{2} b^{2}+4 b^{2} c d x +2 b^{2} c^{2}-d^{2}\right ) \cos \left (2 b x +2 a \right )}{8 b^{3}} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
maxima [B] time = 0.46, size = 522, normalized size = 2.88 \[ -\frac {12 \, {\left (\sin \left (b x + a\right )^{2} - \log \left (\sin \left (b x + a\right )^{2}\right )\right )} c^{2} - \frac {24 \, {\left (\sin \left (b x + a\right )^{2} - \log \left (\sin \left (b x + a\right )^{2}\right )\right )} a c d}{b} + \frac {12 \, {\left (\sin \left (b x + a\right )^{2} - \log \left (\sin \left (b x + a\right )^{2}\right )\right )} a^{2} d^{2}}{b^{2}} - \frac {-8 i \, {\left (b x + a\right )}^{3} d^{2} + {\left (-24 i \, b c d + 24 i \, a d^{2}\right )} {\left (b x + a\right )}^{2} + 48 \, d^{2} {\rm Li}_{3}(-e^{\left (i \, b x + i \, a\right )}) + 48 \, d^{2} {\rm Li}_{3}(e^{\left (i \, b x + i \, a\right )}) + {\left (24 i \, {\left (b x + a\right )}^{2} d^{2} + {\left (48 i \, b c d - 48 i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), \cos \left (b x + a\right ) + 1\right ) + {\left (-24 i \, {\left (b x + a\right )}^{2} d^{2} + {\left (-48 i \, b c d + 48 i \, a d^{2}\right )} {\left (b x + a\right )}\right )} \arctan \left (\sin \left (b x + a\right ), -\cos \left (b x + a\right ) + 1\right ) + 3 \, {\left (2 \, {\left (b x + a\right )}^{2} d^{2} + 4 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )} - d^{2}\right )} \cos \left (2 \, b x + 2 \, a\right ) + {\left (-48 i \, b c d - 48 i \, {\left (b x + a\right )} d^{2} + 48 i \, a d^{2}\right )} {\rm Li}_2\left (-e^{\left (i \, b x + i \, a\right )}\right ) + {\left (-48 i \, b c d - 48 i \, {\left (b x + a\right )} d^{2} + 48 i \, a d^{2}\right )} {\rm Li}_2\left (e^{\left (i \, b x + i \, a\right )}\right ) + 12 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} + 2 \, \cos \left (b x + a\right ) + 1\right ) + 12 \, {\left ({\left (b x + a\right )}^{2} d^{2} + 2 \, {\left (b c d - a d^{2}\right )} {\left (b x + a\right )}\right )} \log \left (\cos \left (b x + a\right )^{2} + \sin \left (b x + a\right )^{2} - 2 \, \cos \left (b x + a\right ) + 1\right ) - 6 \, {\left (b c d + {\left (b x + a\right )} d^{2} - a d^{2}\right )} \sin \left (2 \, b x + 2 \, a\right )}{b^{2}}}{24 \, b} \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
mupad [F] time = 0.00, size = -1, normalized size = -0.01 \[ \int {\cos \left (a+b\,x\right )}^2\,\mathrm {cot}\left (a+b\,x\right )\,{\left (c+d\,x\right )}^2 \,d x \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
sympy [F] time = 0.00, size = 0, normalized size = 0.00 \[ \int \left (c + d x\right )^{2} \cos ^{2}{\left (a + b x \right )} \cot {\left (a + b x \right )}\, dx \]
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________